前序遍历
class Solution {
public:
    vector<int> inorderTraversal(TreeNode* root) {
        stack<TreeNode*> S;
        vector<int> v;
        TreeNode* rt = root;
        while (rt || S.size()) {
            while (rt) {
                S.push(rt->right);
                v.push_back(rt->val);
                rt = rt->left;
            }
            rt = S.top();
            S.pop();
        }
        return v;
    }
};
